package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func main() {
	r := gin.Default()
	r.Static("/images", "./images")
	r.LoadHTMLGlob("./templates/*")
	r.GET("/hello", func(c *gin.Context) {
		c.HTML(http.StatusOK, "index.html", gin.H{
			"title": "index",
		})
	})

	r.GET("/happy", func(c *gin.Context) {
		c.HTML(http.StatusOK, "happy.html", gin.H{
			"title": "happy",
		})
	})

	r.GET("/hi", func(c *gin.Context) {
		c.JSON(200, gin.H{
			"message": "hi",
		})
	})

	r.Run(":8080")
}
